package org.easymis.crm.modules.system.service.impl;

import java.util.HashMap;
import java.util.List;

import org.easymis.crm.modules.system.entitys.mybatis.dto.HrmStaffInfo;
import org.easymis.crm.modules.system.entitys.mybatis.mapper.HrmStaffInfoMapper;
import org.easymis.crm.modules.system.service.HrmStaffInfoMng;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;
@Service
public class HrmStaffInfoMngImpl implements HrmStaffInfoMng {
	@Autowired
	HrmStaffInfoMapper mapper;
/*	@Autowired
	OrganizeRoleMapper roleMapper;
	@Autowired
	OrganizeFunctionMapper functionMapper;*/
	@Override
	public List<HrmStaffInfo> getList(HashMap<String, Object> params) {
		// TODO Auto-generated method stub
		return mapper.getList(params);
	}

	@Override
	public void save(HrmStaffInfo bean) {
		// TODO Auto-generated method stub
		mapper.save(bean);
	}

	@Override
	public void saveBatch(List<HrmStaffInfo> beans) {
		// TODO Auto-generated method stub
		mapper.saveBatch(beans);
	}

	@Override
	public void update(HrmStaffInfo bean) {
		// TODO Auto-generated method stub
		mapper.update(bean);
	}

	@Override
	public void delete(String staffId) {
		// TODO Auto-generated method stub
		mapper.delete(staffId);
	}

	@Override
	public void removeBatch(List<String> list) {
		// TODO Auto-generated method stub
		mapper.removeBatch(list);
	}

	@Override
	public void restoreBatch(List<String> list) {
		// TODO Auto-generated method stub
		mapper.restoreBatch(list);
	}

	@Override
	public void deleteBatch(List<String> list) {
		// TODO Auto-generated method stub
		mapper.deleteBatch(list);
	}

	@Override
	public HrmStaffInfo findById(String staffId) {
		// TODO Auto-generated method stub
		return mapper.findById(staffId);
	}

	@Override
	public HrmStaffInfo findByMemberId(String staffId) {
		// TODO Auto-generated method stub
		return mapper.findById(staffId);
	}

	@Override
	public HrmStaffInfo findByMemberAndOrganize(String memberId, String organizeId) {
		HrmStaffInfo staff=mapper.findById("000002");
/*		List<OrganizeRole> roles = roleMapper.findByMemberId(staff.getStaffId());
		Set<OrganizeRole> organizeRoles = new HashSet<OrganizeRole>();
		for (int i = 0; i < roles.size(); i++) {
			organizeRoles.add(roles.get(i));			
		}
		staff.setOrganizeRoles(organizeRoles);*/
		//staff.setOrganizeFunctions(functionMapper.findByStaffId(staff.getStaffId()));

		return staff;
	}

	@Override
	public List<HrmStaffInfo> findByIds(List<String> list) {
		// TODO Auto-generated method stub
		return mapper.findByIds(list);
	}

	@Override
	public String batchImport(String fileName, MultipartFile mfile) {
		// TODO Auto-generated method stub
		return null;
	}

}
